import React from 'react';
// import { Avatar } from 'antd';
import BizIcon from '@/components/BizIcon';
import styles from './index.less';

const PersonInfo = ({ data, onClick, ...rest }) => {
    const list = [
        {
            title: ['', '男', '女'][data?.talentSex || 0],
            value: data?.talentSex
        },
        {
            title: data?.talentAge,
            value: data?.talentAge
        },
        {
            title: `${data?.talentWorkYearNum}年工作经验`,
            value: data?.talentWorkYearNum
        },
        {
            title: ['', '在职', '离职', '应届生'][data?.lastPostStatus || 0],
            value: data?.lastPostStatus
        }
    ];

    return (
        <div className={styles.personInfo} {...rest}>
            {/* <Avatar size={42} icon="user" src={data?.talentAvatar} /> */}
            <div className={styles.main}>
                <div
                    style={{
                        fontSize: 18,
                        color: '#2A2F3C',
                        display: 'flex',
                        alignItems: 'center',
                        lineHeight: '22px',
                        justifyContent: 'space-between'
                    }}
                >
                    {data?.talentName || ''}
                    <BizIcon
                        style={{ marginLeft: 8, marginTop: 4, fontSize: 20, color: '#B0B5BF' }}
                        type="listfunction_edit_icon_default"
                        onClick={onClick}
                    />
                </div>
                <div style={{ fontSize: 14, color: '#858B9B' }}>
                    {list
                        .filter(item => item.value)
                        .map(item => item.title)
                        .join(' · ')}
                </div>
                <div style={{ marginTop: 16, paddingTop: 16, borderTop: '1px solid #F2F3F4', color: '#2A2F3C' }}>
                    <span
                        style={{
                            fontSize: 14,
                            color: '#858B9B'
                        }}
                    >
                        {' '}
                        应聘岗位：
                    </span>
                    {data?.dutyName || '--'}
                </div>
                <div style={{ marginTop: 4, color: '#2A2F3C' }}>
                    <span
                        style={{
                            fontSize: 14,
                            color: '#858B9B'
                        }}
                    >
                        {' '}
                        应聘日期：
                    </span>
                    {data?.acceptDate || '--'}
                </div>
            </div>
        </div>
    );
};

export default PersonInfo;
